import request from '@/config/axios'

// 诊断结果 VO
export interface diagnosisVO {
  id: number // 文章唯一标识ID，自增长
  consultId: number // 问诊记录id
  suggestion: string // 建议
  prescription: string // 处方
  preDiag: string // 初步诊断
}

// 诊断结果 API
export const diagnosisApi = {
  // 查询诊断结果分页
  getdiagnosisPage: async (params: any) => {
    return await request.get({ url: `/chat/diagnosis/page`, params })
  },

  // 查询诊断结果详情
  getdiagnosis: async (id: number) => {
    return await request.get({ url: `/chat/diagnosis/get?id=` + id })
  },

  // 新增诊断结果
  creatediagnosis: async (data: diagnosisVO) => {
    return await request.post({ url: `/chat/diagnosis/create`, data })
  },

  // 修改诊断结果
  updatediagnosis: async (data: diagnosisVO) => {
    return await request.put({ url: `/chat/diagnosis/update`, data })
  },

  // 删除诊断结果
  deletediagnosis: async (id: number) => {
    return await request.delete({ url: `/chat/diagnosis/delete?id=` + id })
  },

  // 导出诊断结果 Excel
  exportdiagnosis: async (params) => {
    return await request.download({ url: `/chat/diagnosis/export-excel`, params })
  },
}